package com.zb.Service.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zb.Service.InternetService;
import com.zb.entity.Internet;
import com.zb.mapper.InternetMapper;
import com.zb.util.PageUtil10;


@Component
public class InternetServiceImpl implements InternetService{
	@Autowired
	private InternetMapper im;
	public void getPageByUid(PageUtil10 pu, int uid) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("index", (pu.getIndex()-1)*pu.getSize());
		map.put("size", pu.getSize());
		map.put("uid", uid);
		pu.setData(im.getPageByUid(map));
		pu.setCount(getPageCount(map));
	}

	public int getPageCount(Map<String, Object> map) {
		return im.getPageCount(map);
	}

	public int addInternet(Internet inter) {
		return im.addInternet(inter);
	}

	public int deleteInternet(int iid) {
		return im.deleteInternet(iid);
	}

	public int updateInternet(Internet inter) {
		return im.updateInternet(inter);
	}

}